package com.gh.duixiang01;

import org.junit.Test;


public class Circle {

    @Test
    public void test(){
        CircleTest circle = new CircleTest();
        double radius = 2;

        circle.setRadius(radius);
        circle.area();

        double area = circle.area();

    }


}


//
class CircleTest {

    //半径
    double radius;

    public void setRadius(double i){
        this.radius = i;
    }

    public double area(){
        double area = Math.PI * radius * radius;
        System.out.println(area);
        return area;
    }

}

